package com.carkeeper.carType.mapper;

import com.carkeeper.pojo.Brand;
import com.carkeeper.pojo.BrandType;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author zhangmingxin
 * @version 1.0
 * @date 2020/11/24 20:25
 */
public interface CarTypeMapper  extends Mapper<Brand> {
    //新增车标
    @Insert("INSERT INTO tb_brand(id,name,country) values (#{id},#{name},#{country})")
    void addCar(Brand brand);


    //根据品牌id进行查询品牌类别
    @Select("select t1.id,t2.code,t2.name from tb_brand t1,tb_brand_type t2 where t1.id=#{id} and t1.bid=#{t2.brand_id}")
    List<BrandType> selectById(Integer id);
}
